<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: ipixswitch</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: ipixswitch</td>
      <td class="subheader-left"><a href="matlab:open ipixswitch">View code for ipixswitch</a></td>
    </tr>
  </table>
<h1>ipixswitch</h1><p><span class="helptopic">Pixelwise image merge</span></p><strong>out</strong> = <span style="color:red>ipixswitch</span>(<strong>mask</strong>, <strong>im1</strong>, <strong>im2</strong>) is an image where each pixel is
selected from the corresponding pixel in <strong>im1</strong> or <strong>im2</strong> according to the
corresponding values of <strong>mask</strong>.  If the element of <strong>mask</strong> is zero <strong>im1</strong> is
selected, otherwise <strong>im2</strong> is selected.

<h2>Notes</h2>
<ul>
  <li>IM1 and IM2 must have the same number of rows and columns</li>
  <li>if IM1 and IM2 are both greyscale then OUT is greyscale</li>
  <li>if either of IM1 and IM2 are color then OUT is color</li>
</ul>
<h2>See also</h2>
<p>
<a href="matlab:doc colorize">colorize</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2011 Peter Corke.</p>
</body></html>